package com.roc.service.impl;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.roc.dao.DaoException;
import com.roc.newPage.IPageDao;
import com.roc.pojo.Operators;
import com.roc.pojo.TblEditMchtPicture;
import com.roc.service.IMerinfoImageService;
import com.roc.service.ServiceException;
import com.roc.service.merinfo.MerInfoImportBatchService;

@Service
@Transactional(rollbackFor = { ServiceException.class })
public class MerinfoImageServiceImpl implements IMerinfoImageService {
	private static Logger logger = LogManager
			.getLogger(MerinfoImageServiceImpl.class);
	
	@Autowired
	private IPageDao pageDao;
	
	@Override
	public List queryMerinfoImage(String merchantNo) {
		// TODO Auto-generated method stub
		List list = new ArrayList();
		String hql="from TblEditMchtPicture where MchtCd=? and  Url like 'http%' ";
		//String hql ="from TblEditMchtPicture where Url like 'http%'";
		try {
			list= pageDao.queryAll(hql, new Object[]{merchantNo});
		//	list= pageDao.queryAll(hql, new Object[]{});
		} catch (DaoException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			logger.error("加载商户图片信息失败", e);
		}
		return list;
	}

	@Override
	public List queryMerinfoChangImage(String merchantNo) {
		// TODO Auto-generated method stub
		List list = new ArrayList();
		String hql="from MerinfoChange where mid=?  AND status=? and  Url1 like 'http%' ";
		try {
			list= pageDao.queryAll(hql, new Object[] {merchantNo,"L"});
		
		} catch (DaoException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			logger.error("加载商户图片信息失败", e);
		}
		return list;
	}

	
}
